package websem;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

/**
 * Getting properties from properties file. It avoids to load a file directly where we need it.
 * 
 * @author Jissay
 *
 */
public class WebsemProperties extends Properties {
	
	private static final long serialVersionUID = 1L;
	private static String PROPERTIES_FILE = "res/config.properties";
	
	public WebsemProperties () {
		super();
		
		try {
			this.load(new FileInputStream(PROPERTIES_FILE));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	/*
	 * Every properties on properties file
	 */
	public String getConnectionURL() { return this.getProperty("connectionUrl"); }
	public String getConnectionUser() { return this.getProperty("connectionUser"); }
	public String getConnectionPassword() { return this.getProperty("connectionPassword"); }
	public String getSparqlURI() { return this.getProperty("sparqlUri"); }
}
